package com.sizu.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sizu.common.dto.ContentDto;
import com.sizu.common.vo.ResultEntity;
import com.sizu.entity.TbContent;
import com.sizu.service.ITbContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mht
 * @since 2020-03-26
 */
@Controller
@RequestMapping("/tbContent")
public class TbContentController {
    @Autowired
    ITbContentService iTbContentService;

    @RequestMapping("list")
    public ResultEntity list(ContentDto contentDto){
        Wrapper<TbContent> wrapper = new EntityWrapper<>();
        wrapper.eq("category_id",contentDto.getCategoryId());
        return ResultEntity.ok(iTbContentService.selectList(wrapper));
    }

}
